package com.openxt.nbzj.util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.openxt.nbzj.R;

public class GlideUtil {

    public static void loadImg(Context context, String url, ImageView imageView) {
        Glide.with(context.getApplicationContext())
                .load(url)
                //.placeholder(android.R.drawable.progress_indeterminate_horizontal)
                .placeholder(R.mipmap.ic_empty_photo)
                .crossFade()
                .diskCacheStrategy(DiskCacheStrategy.RESULT)
                .skipMemoryCache(false)
                .into(imageView);
    }

    public static void loadImgCenterCrop(Context context, String url, ImageView imageView) {
        Glide.with(context.getApplicationContext())
                .load(url)
                //.placeholder(android.R.drawable.progress_indeterminate_horizontal)
                .placeholder(R.mipmap.ic_empty_photo)
                .crossFade()
                .centerCrop()
                .diskCacheStrategy(DiskCacheStrategy.RESULT)
                .skipMemoryCache(false)
                .into(imageView);
    }
}
